import Vue from 'vue'
import Vuex from 'vuex'
import { getItem, setItem } from '@/utils/localstorage.js'

Vue.use(Vuex)

const userToken = 'token-user'

export default new Vuex.Store({
  state: {
    userTokens: getItem(userToken)
  },
  mutations: {
    setToken (state, data) {
      state.userTokens = data
      setItem(userToken, data)
    }
  },
  actions: {
  },
  modules: {
  }
})
